package com.hn658.base.message.common.enums;

/**
 * Created by baihai on 2015/11/19.
 */
public enum  EventPriority {


    /**
     * 低
     */
    Low(1),

    /**
     * 普通
     */
    Normal(2),

    /**
     * 高
     */
    High(3);

    /**
     * NotificationPriority对应的Value值(Int)
     */
    private int value;

    EventPriority(int value){
        this.value = value;
    }

    /**
     * 获取NotificationPriority枚举对应的Value值(Int)
     * @return
     */
    public int getValue(){
        return this.value;
    }

    /**
     * 根据Value值(Int)获取对应的EventPriority枚举
     * @param value
     * @return
     */
    public static EventPriority getPriorityByValue(int value){
        for(EventPriority priority : EventPriority.values()){
            if(priority.getValue() == value){
                return priority;
            }
        }
        throw new IllegalArgumentException("未能找到匹配的EventPriority:" + value);
    }

}
